package com.dodolive.app.lib.markwon.core.core.factory;

import android.graphics.Color;
import android.text.style.BackgroundColorSpan;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.dodolive.app.lib.markwon.core.MarkwonConfiguration;
import com.dodolive.app.lib.markwon.core.RenderProps;
import com.dodolive.app.lib.markwon.core.SpanFactory;
import com.dodolive.app.lib.markwon.core.core.CoreProps;
import com.dodolive.app.lib.markwon.core.core.spans.LinkSpan;
import com.dodolive.app.lib.markwon.core.core.spans.MentionLinkSpan;

public class MentionLinkSpanFactory implements SpanFactory {
    @Nullable
    @Override
    public Object getSpans(@NonNull MarkwonConfiguration configuration, @NonNull RenderProps props) {
//        return new BackgroundColorSpan(Color.BLUE);
        return new MentionLinkSpan(
                configuration.theme(),
                "https://www.baidu.com",
//                CoreProps.LINK_DESTINATION.require(props),
                configuration.linkResolver()
        );
    }
}
